import type {ICommonResponse} from "@/types/global";
import request from "@/utils/request";

export interface IGoodItem {
    goodsId: number,
    goodsName: string,
    goodsIntro: string,
    goodsCoverImg: string,
    sellingPrice: number,
    tag: string
}

export interface ICarouselItem {
    carouselUrl: string,
    redirectUrl: string
}

export interface IGetIndexListResponseData {
    carousels: ICarouselItem[],
    hotGoods: IGoodItem[],
    newGoods: IGoodItem[],
    recommendGoods: IGoodItem[]
}

const getIndexListAPI = (): ICommonResponse<IGetIndexListResponseData> => {
    return request({
        url: '/api/v1/index-infos',
        method: "GET",
    })
}

export default getIndexListAPI;